/**
 * 浏览器相关工具方法
 */

export function download(file, fileName) {
	if (window.navigator.msSaveBlob) {
		window.navigator.msSaveBlob(file, fileName);
	} else {
		const url = window.URL.createObjectURL(file);
		console.log('url', url, file);
		const a = document.createElement('a');
		a.href = url;
		a.download = fileName || 'download';
		document.body.appendChild(a);
		a.style.display = 'none';
		a.click();
	}
}
